def findMax(**numbers):
  print(numbers)# 参数是一个字典
  print(max(numbers.values()))
findMax(c=3,y=2,a=1,b=2)

def findMax1(*args):
  print(args) # 参数是元组
  print(max(args))
findMax1(1,2,3,4,5,6,7,8,9,10)

def my_function(*args, **kwargs):
    print("Positional arguments:", args)
    print("Keyword arguments:", kwargs)
# 假设我们有一个列表和一个字典
my_list = [1, 2, 3]
my_dict = {'a': 4, 'b': 5}

# 可以这样调用函数
my_function(*my_list, **my_dict)

def my_function1(args, kwargs):
    print("Positional arguments:", args)
    print("Keyword arguments:", kwargs)
my_function1(my_list, my_dict)

# keyword-only arguments
def my_function2(*arr, arg1, arg2):
    print("arg1:", arg1)
    print("arg2:", arg2)
    print("arr:", arr)
my_function2(3,4,5,arg1=1, arg2=2)

# 参数列表序列
def test(a,b,c,d=5,*nums,x="X",**obj):
   print("参数列表序列")
   print(a,b,c,d)
   print(nums)
   print(x)
   print(obj)
test(1,2,3,8,9,x="张三",name="李谦",age=35)

# 实际参数解构
def test1(*nums):
   print(nums)
test1(*[1,2,3,4,5])
test1(*{"a","b","c"})
test1(*(1,2,3,9))
test1(*{"a":1,"b":2})

def test2(**nums):
   print(nums)
test2(**{"a":1,"b":2})

# 销毁函数
del test2
# test2(**{"a":1,"b":2}) # 销毁后该函数不可用
# 第二种销毁方式就是定义同名函数